package a05_ThreadInstance;

/**
 * @Author quan
 * @Description TODO
 * @Date 2023/5/8 19:41
 */
public class SingletonHungryTest1 {
    public static void main(String[] args) {
//        SingletonHungry singletonHungry1 = new SingletonHungry();
//        SingletonHungry singletonHungry2 = new SingletonHungry();
//        SingletonHungry singletonHungry3 = new SingletonHungry();
//        System.out.println(singletonHungry1.getInstance());
//        System.out.println(singletonHungry2.getInstance());
//        System.out.println(singletonHungry3.getInstance());
        //通过静态方法调用获取单例
        SingletonHungry singletonHungry01 = SingletonHungry.getInstance();
        SingletonHungry singletonHungry02 = SingletonHungry.getInstance();
        SingletonHungry singletonHungry03 = SingletonHungry.getInstance();
        System.out.println(singletonHungry01);
        System.out.println(singletonHungry02);
        System.out.println(singletonHungry03);

    }
}
